import request from '@/utils/request'
// 返修领料单

// 查询返修任务列表
export function listRepair(params) {
  return request({
    url: '/erp/repairProductMaterialRequisition/repairList',
    method: 'get',
    params
  })
}

export function listRepair1(params) {
  return request({
    url: '/erp/repairProductMaterialRequisition/repairList1',
    method: 'get',
    params
  })
}

// 返修列表子菜单查询
export function listRepairChild(params) {
  return request({
    url: '/erp/repairProductMaterialRequisition/list',
    method: 'get',
    params
  })
}

// 删除列表子菜单查询
export function deleteRepairChild(id) {
  return request({
    url: '/erp/repairProductMaterialRequisition/'+id,
    method: 'delete'
  })
}

// 生成领料单
export function generateMaterial(data) {
  return request({
    url: '/erp/repairMaterial/generateMaterial',
    method: 'post',
    data
  })
}

// 新增
export function addRepair(data) {
  return request({
    url: '/erp/repairProductMaterialRequisition',
    method: 'post',
    data
  })
}

// 新增筛选的产品列表
export function getProductList(params) {
  console.log(params)
  return request({
    url: '/erp/repairProductMaterialRequisition/repairProductList',
    method: 'get',
    params: params
  })
}


export function getProductList1(params) {
  console.log(params)
  return request({
    url: '/erp/repairProductMaterialRequisition/repairProductList1',
    method: 'get',
    params: params
  })
}


// // 生产计划新增时查询
// export function getProductPlan(data) {
//   return request({
//     url: '/TProductionPlan/TProductionPlan/getInfolist',
//     method: 'post',
//     data
//   })
// }

// // 新增
// export function addRepair(data) {
//   return request({
//     url: '/TProductionPlan/TProductionPlan/repairplan',
//     method: 'post',
//     data
//   })
// }




// 审批
export function approverRepair(data) {
  return request({
    url: '/erp/repairProductMaterialRequisition/approverRepair',
    method: 'post',
    data
  })
}
// 提交

export function submitRepair(data) {
  return request({
    url: '/erp/repairProductMaterialRequisition/submitRepair',
    method: 'post',
    data
  })
}

// 审批数据



export function approvalRecord(data) {
  return request({
    url: '/erp/repairProductMaterialRequisition/approvalRecord',
    method: 'post',
    data
  })
}
